.class Lcom/waiqin365/lightapp/im/activity/az;
.super Ljava/lang/Object;

# interfaces
.implements Landroid/widget/AbsListView$OnScrollListener;


# instance fields
.field final synthetic a:Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;


# direct methods
.method private constructor <init>(Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;)V
    .locals 0

    iput-object p1, p0, Lcom/waiqin365/lightapp/im/activity/az;->a:Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method synthetic constructor <init>(Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;Lcom/waiqin365/lightapp/im/activity/ai;)V
    .locals 0

    invoke-direct {p0, p1}, Lcom/waiqin365/lightapp/im/activity/az;-><init>(Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;)V

    return-void
.end method


# virtual methods
.method public onScroll(Landroid/widget/AbsListView;III)V
    .locals 0

    return-void
.end method

.method public onScrollStateChanged(Landroid/widget/AbsListView;I)V
    .locals 7

    const/16 v6, 0x14

    const/16 v5, 0x8

    const/4 v4, 0x0

    packed-switch p2, :pswitch_data_0

    :cond_0
    :goto_0
    return-void

    :pswitch_0
    invoke-virtual {p1}, Landroid/widget/AbsListView;->getFirstVisiblePosition()I

    move-result v0

    if-nez v0, :cond_0

    iget-object v0, p0, Lcom/waiqin365/lightapp/im/activity/az;->a:Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;

    invoke-static {v0}, Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;->G(Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;)Z

    move-result v0

    if-nez v0, :cond_0

    iget-object v0, p0, Lcom/waiqin365/lightapp/im/activity/az;->a:Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;

    invoke-static {v0}, Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;->H(Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;)Z

    move-result v0

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/waiqin365/lightapp/im/activity/az;->a:Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;

    invoke-static {v0}, Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;->I(Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;)Landroid/widget/ProgressBar;

    move-result-object v0

    invoke-virtual {v0, v4}, Landroid/widget/ProgressBar;->setVisibility(I)V

    :try_start_0
    iget-object v0, p0, Lcom/waiqin365/lightapp/im/activity/az;->a:Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;

    invoke-static {v0}, Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;->J(Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;)Lcom/hyphenate/chat/EMConversation;

    move-result-object v0

    iget-object v1, p0, Lcom/waiqin365/lightapp/im/activity/az;->a:Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;

    invoke-static {v1}, Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;->w(Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;)Lcom/waiqin365/lightapp/im/adapter/f;

    move-result-object v1

    const/4 v2, 0x0

    invoke-virtual {v1, v2}, Lcom/waiqin365/lightapp/im/adapter/f;->a(I)Lcom/hyphenate/chat/EMMessage;

    move-result-object v1

    invoke-virtual {v1}, Lcom/hyphenate/chat/EMMessage;->getMsgId()Ljava/lang/String;

    move-result-object v1

    const/16 v2, 0x14

    invoke-virtual {v0, v1, v2}, Lcom/hyphenate/chat/EMConversation;->loadMoreMsgFromDB(Ljava/lang/String;I)Ljava/util/List;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v0

    const-wide/16 v2, 0x12c

    :try_start_1
    invoke-static {v2, v3}, Ljava/lang/Thread;->sleep(J)V
    :try_end_1
    .catch Ljava/lang/InterruptedException; {:try_start_1 .. :try_end_1} :catch_1

    :goto_1
    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v1

    if-eqz v1, :cond_2

    iget-object v1, p0, Lcom/waiqin365/lightapp/im/activity/az;->a:Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;

    invoke-static {v1}, Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;->w(Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;)Lcom/waiqin365/lightapp/im/adapter/f;

    move-result-object v1

    invoke-virtual {v1}, Lcom/waiqin365/lightapp/im/adapter/f;->notifyDataSetChanged()V

    iget-object v1, p0, Lcom/waiqin365/lightapp/im/activity/az;->a:Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;

    iget-object v1, v1, Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;->a:Landroid/widget/ListView;

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v2

    add-int/lit8 v2, v2, -0x1

    invoke-virtual {v1, v2}, Landroid/widget/ListView;->smoothScrollToPosition(I)V

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v0

    if-eq v0, v6, :cond_1

    iget-object v0, p0, Lcom/waiqin365/lightapp/im/activity/az;->a:Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;

    invoke-static {v0, v4}, Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;->h(Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;Z)Z

    :cond_1
    :goto_2
    iget-object v0, p0, Lcom/waiqin365/lightapp/im/activity/az;->a:Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;

    invoke-static {v0}, Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;->I(Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;)Landroid/widget/ProgressBar;

    move-result-object v0

    invoke-virtual {v0, v5}, Landroid/widget/ProgressBar;->setVisibility(I)V

    iget-object v0, p0, Lcom/waiqin365/lightapp/im/activity/az;->a:Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;

    invoke-static {v0, v4}, Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;->i(Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;Z)Z

    goto :goto_0

    :catch_0
    move-exception v0

    iget-object v0, p0, Lcom/waiqin365/lightapp/im/activity/az;->a:Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;

    invoke-static {v0}, Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;->I(Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;)Landroid/widget/ProgressBar;

    move-result-object v0

    invoke-virtual {v0, v5}, Landroid/widget/ProgressBar;->setVisibility(I)V

    goto :goto_0

    :cond_2
    iget-object v0, p0, Lcom/waiqin365/lightapp/im/activity/az;->a:Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;

    invoke-static {v0, v4}, Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;->h(Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;Z)Z

    goto :goto_2

    :catch_1
    move-exception v1

    goto :goto_1

    nop

    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_0
    .end packed-switch
.end method
